﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using IHISCETeim.Library;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using IHISCETeim.Model;


namespace IHISCETeim.DAL
{
    public class OShiYuanReportDAL
    {
        public static bool OShiYuanMonthTopReport_Add(int TopYear, int TopMonth, string TopType, string ChangShangs, string ShuLiangs)
        {
            Database DB = DatabaseFactory.CreateDatabase();
            try
            {
                DbCommand dbCommand = DB.GetStoredProcCommand("OShiYuanMonthTopReport_Add", TopYear, TopMonth, TopType, ChangShangs, ShuLiangs);
                DB.ExecuteScalar(dbCommand);
                return true;
            }
            catch
            {
                return false;
            }
        }
        public static DataTable OShiYuanMonthTopReport_GetData(int TopYear, int TopMonth)
        {
            Database DB = DatabaseFactory.CreateDatabase();
            
                DbCommand dbCommand = DB.GetStoredProcCommand("OShiYuanMonthTopReport_GetData", TopYear, TopMonth);
                return DB.ExecuteDataSet(dbCommand).Tables[0];
           
        }
        public static bool OShiYuanReport_Add(int SYYear, string SYType, string MonthsValue)
        {
            Database DB = DatabaseFactory.CreateDatabase();
             try
            {
                DbCommand dbCommand = DB.GetStoredProcCommand("OShiYuanReport_Add", SYYear, SYType, MonthsValue);
                DB.ExecuteScalar(dbCommand);
                return true;
                }
             catch
             {
                 return false;
             }
        }
        public static DataTable OShiYuanReport_GetData(int SYYear)
        {
            Database DB = DatabaseFactory.CreateDatabase();

            DbCommand dbCommand = DB.GetStoredProcCommand("OShiYuanReport_GetData", SYYear);
            return DB.ExecuteDataSet(dbCommand).Tables[0];
        }
    }
}
